Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

command: highlight selected list items with color #15286

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

guidocella
Copy link
Contributor

@guidocella guidocella commented Nov 9, 2024

Instead of printing circles in show-text ${playlist}, ${chapter-list} and ${edition-list}, introduce --osd-selected-color and --osd-selected-outline-color to reduce clutter, make the selected item easier to differentiate, and have visual consistency with select.lua.

The defaults are taken from the style of the selected item in the console. These new options are also used there, replacing the hardcoded styles. Due to being user-configurable, selected item styles are changed to take priority over default item styles.

The default selected style is yellow and bold. The bold (hardcoded) allows differentiating the selected item with color blindness. There is also a separate --osd-selected-outline-color option defaulting to black, since without it if the user changes --osd-outline-color yellow text becomes unreadable without a black border. --osd-selected-back-color is omitted for now.

Text and background colors are inverted for the selected item in the terminal. This is hardcoded, adding an option is overkill.

A disadvantage of this commit is that if you run print-text ${playlist} with a VO, the selected style ASS is printed to the terminal (but ASS printed in the console is interpreted). This commit avoids printing the reset ASS sequence for non-selected items to reduce clutter in this case.

Instead of printing circles in show-text ${playlist}, ${chapter-list}
and ${edition-list}, introduce --osd-selected-color and
--osd-selected-outline-color to reduce clutter, make the selected item
easier to differentiate, and have visual consistency with select.lua.

The defaults are taken from the style of the selected item in the
console. These new options are also used there, replacing the hardcoded
styles. Due to being user-configurable, selected item styles are changed
to take priority over default item styles.

The default selected style is yellow and bold. The bold (hardcoded)
allows differentiating the selected item with color blindness. There is
also a separate --osd-selected-outline-color option defaulting to black,
since without it if the user changes --osd-outline-color yellow text
becomes unreadable without a black border. --osd-selected-back-color is
omitted for now.

Text and background colors are inverted for the selected item in the
terminal. This is hardcoded, adding an option is overkill.

A disadvantage of this commit is that if you run print-text ${playlist}
with a VO, the selected style ASS is printed to the terminal (but ASS
printed in the console is interpreted). This commit avoids printing the
reset ASS sequence for non-selected items to reduce clutter in this
case.
Copy link

github-actions bot commented Nov 9, 2024

Download the artifacts for this pull request:

Windows
macOS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant